import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    component: () => import("../views/Home/HomeIndex.vue"),
    children: [
      {
        path: "/home",
        redirect: "/home/realtime",
      },
      {
        path: "/home/realtime",
        component: () => import("@/views/Home/data-realtime/DataRealtime.vue"),
      },
      {
        path: "/home/customer",
        component: () => import("@/views/Home/data-customer/DataCustomer.vue"),
      },
      {
        path: "/home/all",
        component: () => import("@/views/Home/goods-all/GoodsAll.vue"),
      },
      {
        path: "/home/add",
        component: () => import("@/views/Home/goods-add/GoodsAdd.vue"),
      },
      {
        path: "/home/add2",
        component: () => import("@/views/Home/goods-add2/GoodsAdd2.vue"),
      },
      {
        path: "/home/addCoupon",
        component: () => import("@/views/Home/market-addCoupon/AddCoupon.vue"),
      },
      {
        path: "/home/addSeckill",
        component: () =>
          import("@/views/Home/market-addSeckill/AddSeckill.vue"),
      },
      {
        path: "/home/coupon",
        component: () => import("@/views/Home/market-coupon/MarketCoupon.vue"),
      },
      {
        path: "/home/seckill",
        component: () =>
          import("@/views/Home/market-seckill/MarketSeckill.vue"),
      },
      {
        path: "/home/abnormal",
        component: () =>
          import("@/views/Home/order-abnormal/OrderAbnormal.vue"),
      },
      {
        path: "/home/order-all",
        component: () => import("@/views/Home/order-all/OrderAll.vue"),
      },
      {
        path: "/home/cancel",
        component: () => import("@/views/Home/order-cancel/OrderCancel.vue"),
      },
      {
        path: "/home/unpaid",
        component: () => import("@/views/Home/order-unpaid/OrderUnpaid.vue"),
      },
      {
        path: "/home/unreceived",
        component: () => import("@/views/Home/order-unreceived/UnReceived.vue"),
      },
      {
        path: "/home/unshipped",
        component: () => import("@/views/Home/order-unshipped/UnShipped.vue"),
      },
    ],
  },
  {
    path: "/login",
    component: () => import("../views/Login/LoginIndex.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
